<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改家庭档案管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-family-edit" th:object="${family}">
            <input name="id" th:field="*{id}" type="hidden">
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">县级编号：</label>
                <div class="col-sm-8">
                    <input name="countyCode" th:field="*{countyCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">乡镇编号：</label>
                <div class="col-sm-8">
                    <input name="townCode" th:field="*{townCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">村编号：</label>
                <div class="col-sm-8">
                    <input name="countysideCode" th:field="*{countysideCode}" class="form-control" type="text">
                </div>
            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">组编号：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <input id="treeId" name="groupCode" type="hidden" th:value="${sysArea?.areaId}"/>
                        <input class="form-control" type="text" onclick="selectAreaTree()" id="treeName" readonly="true" th:field="*{groupCode}">
                        <span class="input-group-addon"><i class="fa fa-search"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">家庭编号：</label>
                <div class="col-sm-8">
                    <input name="familyCode" th:field="*{familyCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">户属性：</label>
                <div class="col-sm-8">
                    <input name="familyProperty" th:field="*{familyProperty}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">户主姓名：</label>
                <div class="col-sm-8">
                    <input name="householderName" th:field="*{householderName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">家庭人口数：</label>
                <div class="col-sm-8">
                    <input name="familyNumberPeople" th:field="*{familyNumberPeople}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">农业人口数：</label>
                <div class="col-sm-8">
                    <input name="familyFarmPeople" th:field="*{familyFarmPeople}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">家庭住址：</label>
                <div class="col-sm-8">
                    <input name="familyAddress" th:field="*{familyAddress}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">登记员：</label>
                <div class="col-sm-8">
                    <input name="Registrant" th:field="*{registrant}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/family";
        $("#form-family-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-family-edit').serialize());
            }
        }

        /*行政区域管理-新增-选择行政区域树*/
        function selectAreaTree() {
            var options = {
                title: '行政区域选择',
                width: "380",
                url: "/system/area/selectAreaTree/" + $("#treeId").val(),
                callBack: doSubmit
            };
            $.modal.openOptions(options);
        }

        /*行政区域树的回调函数*/
        function doSubmit(index, layero){
            var body = layer.getChildFrame('body', index);
            $("#treeId").val(body.find('#treeId').val());
            $("#treeName").val(body.find('#treeName').val());
            layer.close(index);
        }
    </script>
</body>
</html>
